package com.jk.lzy.controller;

import com.jk.OrderBean;
import com.jk.service.MovieInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Timer;
import java.util.TimerTask;

/**
 * @Author: 梁展艺
 * @Description:  跳转 购票 页面
 * @Date: 2021/5/24 10:58
 * @param null
 * @Return:
 **/
@Controller()
@RequestMapping("cinemaInfoPage")
public class MovieInfoPageController {
    // 注入 业务层
    @Autowired
    private MovieInfoService lzyUserService;
    /**
     * @Author: 梁展艺
     * @Description:
     * @Date: 2021/5/26 10:46
     * @param cinemaId
     * @param movieId
     * @param model
     * @Return: java.lang.String
     **/
    @RequestMapping("cinemaInfo")
    public String cinemaInfo(Integer cinemaId,Integer movieId, Model model){
        model.addAttribute("cinemaId",cinemaId);
        model.addAttribute("movieId",movieId);
        return "cinemaInfo/index";
    }
    @RequestMapping("seat")
    public String seat(Integer programId,Double moviePrice,Model model){
        model.addAttribute("programId",programId);
        model.addAttribute("moviePrice",moviePrice);
        return "seat/index";
    }
    /**
     * @Author: 梁展艺
     * @Description:  订单页面
     * @Date: 2021/5/27 14:22
     * @Return: java.lang.String
     **/
    @RequestMapping("orderInfo")
    public String orderInfo(OrderBean orderBean, Model model){
        OrderBean order = lzyUserService.orderInfoByOrder(orderBean);
        model.addAttribute("order",order);
        return "order/index";
    }
}
